package org.dbwebx.jcr;

import org.dbwebx.jcr.domain.DbUnitNode;

public interface JcrService {

	/**
	 * Creates node on given path.
	 * 
	 * @param nodePath
	 *            the path to create node
	 * @return created node path
	 */
	public abstract String add(final String nodePath);

	/**
	 * Finds {@link DbUnitNode} by given path.
	 * 
	 * @param path
	 *            the path to find {@link DbUnitNode} on
	 * @return found {@link DbUnitNode}
	 */
	public abstract DbUnitNode find(final String path);

	/**
	 * Persists given <code>nodeName</code> on a given <code>basePath</code>
	 * with a given <code>nodeValue</code>.
	 * 
	 * @param basePath
	 *            the path to persist node on
	 * @param nodeName
	 *            the node name to persist
	 * @param nodeValue
	 *            the value to set to persisted node
	 * @return persisted {@link DbUnitNode}
	 */
	public abstract DbUnitNode persist(final String basePath,
			final String nodeName, final String nodeValue);

}